package com.ruoyi.web.service;

import com.aliyuncs.exceptions.ClientException;
import org.springframework.web.multipart.MultipartFile;

import java.net.URL;

/**
 * @author zr 2024/2/29
 */
public interface FileService {
    /**
     * 阿里云OSS文件上传
     *
     * @param file
     * @return
     */
    String upload(MultipartFile file, String objectName) throws ClientException;

    /**
     * 删除文件
     *
     * @return
     */
    String del(String objectName) throws ClientException;

    /**
     * 获取文件url
     *
     * @param objectName
     * @return
     * @throws Exception
     */
    URL getUrl(String objectName);
}
